#include "Segment.h"
#include "..\SDL\include\SDL.h"

Segment::Segment(){}

Segment::~Segment(){};

Segment::Segment(std::string id, Point x1, Point x2,Color *borderColor){
	this->x1 = x1;
	this->x2 = x2;
	this->borderColor=borderColor;
	this->id=id;
}

Segment::Segment(std::string id, Point x1,Point x2,Texture *texture){
	this->x1 = x1;
	this->x2 = x2;
	this->borderColor=NULL;
	this->texture=texture;
	this->id=id;
};

void Segment::draw() {
	if(borderColor!=NULL)
		SurfaceContainer::getInstance()->drawLine(x1,x2,this->borderColor->getSDLColor());
}

std::string Segment::getCreationLog(){
	std::string msj = "Se creo un Segmento id: '";
	std::stringstream ss; 
	ss << id;
	msj+= ss.str();
	msj.append("'");
	return msj;
}
